

import {Entity, Column, Index} from 'typeorm';
import {BaseEntity} from "@/entitys/common/baseEntity";
import {PayType} from "@/typing/payType";
import {SupplierType} from "@/typing/supplierType";

@Index(["tourGroupId", "companyId"])
@Entity()
export class BasisTripDataEntity extends BaseEntity {
    @Column({comment: '团ID', nullable: true})
    tourGroupId: number;

    @Column({comment: '行程数据类型', type: 'enum', enum: SupplierType})
    supplierType: SupplierType;

    @Column({comment: '供应商ID', nullable: true})
    supplierId: number;

    // @Column({comment: '使用资源规格Id'})
    // specificationId: string;

    @Column({comment: '项目明细', nullable: true})
    detail: string;

    @Column({comment: '开始日期', type: 'date', nullable: true})
    startDate: Date;

    @Column({comment: '结束日期', type: 'date', nullable: true})
    endDate: Date;

    @Column({comment: '单价'})
    price: number;

    @Column({comment: '数量'})
    amount: number;

    @Column({comment: '币种'})
    currency: string;

    @Column({comment: '合计'})
    total: number;

    @Column({comment: '支付方式', type: "enum", enum: PayType, default: PayType.companyPay})
    payType: PayType;
}
